﻿#include<iostream>
#include "Espresso.h"
#include "Mocha.h"
#include "Soy.h"
#include "HouseBlend.h"
#include "Whip.h"
using namespace std;

/// @brief 装饰者模式，使用示例
void f1() {
	cout << "来一杯浓缩咖啡，不加任何调料：" << endl;
	Beverage* espresso1 = new Espresso();
	cout << "\t" << espresso1->getDes() << ": " << espresso1->cost() << "元" << endl;

	cout << "#################################################################################" << endl;
	cout << "来一杯浓缩咖啡，加Mocha：" << endl;
	condimentDecorate* mocha1 = new Mocha(espresso1);
	cout << "\t" << mocha1->getDes() << ": " << mocha1->cost() << "元" << endl;

	cout << "#################################################################################" << endl;
	cout << "来一杯浓缩咖啡，加双份Mocha：" << endl;
	condimentDecorate* mocha2 = new Mocha(mocha1);
	cout << "\t" << mocha2->getDes() << ": " << mocha2->cost() << "元" << endl;

	cout << "#################################################################################" << endl;
	cout << "来一杯浓缩咖啡，加Soy：" << endl;
	condimentDecorate* soy1 = new Soy(espresso1);
	cout << "\t" << soy1->getDes() << ": " << soy1->cost() << "元" << endl;

	cout << "#################################################################################" << endl;
	cout << "来一杯浓缩咖啡，加Soy和Moncha：" << endl;
	condimentDecorate* soy2 = new Soy(mocha1);
	cout << "\t" << soy2->getDes() << ": " << soy2->cost() << "元" << endl;

	cout << "#################################################################################" << endl;
	cout << "来一杯白兰地，加Soy/Moncha/Whip：" << endl;
	Beverage* houseblend1 = new HouseBlend();
	condimentDecorate* soy3 = new Soy(houseblend1);
	condimentDecorate* monch3 = new Mocha(soy3);
	condimentDecorate* whip1 = new Whip(monch3);
	cout << "\t" << whip1->getDes() << ": " << whip1->cost() << "元" << endl;
}

int main() {
	f1();

	return 0;
}